import os


def save_ls(ls):
    ss = ','.join([str(i) for i in ls])
    with open('cache.txt', 'w+') as f:
        f.write(ss)


def get_ls():
    if not os.path.exists('cache.txt'):
        return None

    with open('cache.txt', 'r') as f:
        data = f.read()

    l1 = data.split(',')
    ll = [int(i) for i in l1]
    return ll


if __name__ == '__main__':
    ls = [10, 30, 20]
    save_ls(ls)
    get_ls()

    os.remove('cache.txt')
    1
